import request from '@/utils/request';
import requestJava from '@/utils/requestJava.js';

export default {
	/**
	 * 供应链登录请求
	 * @param {Object} data
	 */
	async supplyLogin(data) {
		return await requestJava({
			url: "/api/user/login9",
			data: data,
			method: 'POST',
			contentType: 1,
			channel: 2
		})
	},
	/**
	 * 获取所在区域
	 */
	async listArea() {
		return await requestJava({
			url: "/api/region/getRegionList",
			data: {
				regionName: "",
				pageNo: 1,
				pageSize: 1000,
			},
			method: 'POST',
			contentType: 2,
			channel: 2			
		})
	},
	/**
	 * 供应链获取个人信息
	 * @param {Object} data
	 */
	async loginNoPass(data) {
		return await requestJava({
			url: "/api/user/loginNoPass",
			data: data,
			method: 'POST',
			contentType: 2,
			channel: 2
		})
	},
	/**
	 * 获取备货单
	 * @param {Object} data
	 */
	async getStockList(data) {
		return await request({
			url: "/interface/public/index.php/yun/Cpku/get_num_order",
			data: data,
			method: 'POST',
			contentType: 1,
			channel: 3
		}, true)
	},
	
	/**
	 * 获取发货记录
	 * @param {Object} data
	 */
	async getFHList(data) {
		return await request({
			url: "/interface/public/index.php/yun/Cpku/getFaHuo",
			data: data,
			method: 'POST',
			contentType: 1,
			channel: 3
		}, true)
	},
	/**
	 * 供应链获取个人信息
	 */
	async getUserInfo() {
		return await requestJava({
			url: "/api/sysUser/getInfo",
			method: 'GET',
			contentType: 2,
			channel: 2
		})
	},	
		
	/**
	 * 获取版本记录
	 * @param {Object} data
	 */
	async getVersion(data) {
		return await requestJava({
			url: "/api/version/getVersion",
			data: data,
			method: 'POST',
			contentType: 2,
			channel: 2
		}, true)
	},
}